package com.hky.front_end_monitor.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hky.front_end_monitor.entity.SysResourceFlowAndWebVital;
import com.hky.front_end_monitor.service.SysResourceFlowAndWebVitalService;
import com.hky.front_end_monitor.mapper.SysResourceFlowAndWebVitalMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
* @author hello
* @description 针对表【sys_resource_flow_and_web_vital】的数据库操作Service实现
* @createDate 2022-07-28 22:40:40
*/
@Service
public class SysResourceFlowAndWebVitalServiceImpl extends ServiceImpl<SysResourceFlowAndWebVitalMapper, SysResourceFlowAndWebVital>
    implements SysResourceFlowAndWebVitalService{

    @Override
    public boolean storeRfAndWebVital(String webVitalUUiD, String[] rfUUIDs) {
        ArrayList<SysResourceFlowAndWebVital> rfAndWebVital = new ArrayList<>();
        for (String rfUUID : rfUUIDs) {
            SysResourceFlowAndWebVital rfAnd = new SysResourceFlowAndWebVital();
            rfAnd.setWebVitalId(webVitalUUiD);
            rfAnd.setResourceFlowId(rfUUID);
            rfAndWebVital.add(rfAnd);
        }
        return this.saveBatch(rfAndWebVital);
    }
}




